{% extends "base.html" %}
{% load slots %}
{% load i18n %}
{% load miraflores_tags %}
{% load markup %}
{% load comments %}

{% block title %}{{ site.name }}{% endblock %}

{% block extrahead %}
<link href="{% url miraflores_syndication "rss" %}" type="application/rss+xml" rel="alternate" title="{{ site.name }} RSS Feed" />
<link href="{% url miraflores_syndication "atom" %}" type="application/atom+xml" rel="alternate" title="{{ site.name }} Atom Feed" />
{% if user.username %}
  <link href="{% url miraflores_syndication "rss" %}{% feed_user_token user %}/" type="application/rss+xml" rel="alternate" title="{{ site.name }} RSS Feed for {{ user.username }}" />
  <link href="{% url miraflores_syndication "atom" %}{% feed_user_token user %}/" type="application/atom+xml" rel="alternate" title="{{ site.name }} Atom Feed for {{ user.username }}" />
{% endif %}
<script type="text/javascript" src="{{ MEDIA_URL }}{{ jquery_url }}"></script>
{% endblock %}

{% block userlinks %}
{% define_slot com.djangoproject.base.userlinks %}
{% endblock %}

{% block nav-global %}
{% define_slot com.djangoproject.base.nav-global %}
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="/">{% trans 'Home' %}</a> &rsaquo; {% trans 'Blog' %}
</div>
{% endblock %}

{% block content_title %}<h1>Latest Entries</h1>{% endblock %}

{% block content %}
{% block object-tools %}
{% define_slot com.djangoproject.base.object-tools %}
{% endblock %}
<div id="content-main">
	{% for entry in page_obj.object_list %}
	<div class="entry">
	  <h2 class="entry_title"><a href="{{ entry.get_absolute_url }}">{{ entry.title }}</a></h2>
	  {% if not entry.published %}
	    <div class="system-message">
	      <p class="system-message-title">Unpublished Entry</p>
	      <p>{% trans "This entry is unpublished. It is only visible to staff members." %}</p>
	    </div>
	  {% endif %}
	  {% if entry.limit_access %}
	    <div class="system-message">
	      <p>{% trans "This entry is not visible to the general public. It requires special permission to view." %}</p>
	    </div>
	  {% endif %}
	  <div class="entry_body">
	  {% with entry.body|truncated as body %}
	    {{ body|markdown }}
	    {% ifnotequal body entry.body %}
	      <p class="entry_read_more"><a href="{{ entry.get_absolute_url }}">{% trans "Read the rest of this entry..." %}</a></p>
	    {% endifnotequal %}
	  {% endwith %}
	  </div>
	  <div class="entry_footer">
	  	<p class="entry_published_date">{% blocktrans with entry.last_updated|date:"N j, Y P" as last_updated %}Published {{ last_updated }}{% endblocktrans %}</p>
	    <p class="entry_citation"><cite>{% blocktrans with entry.author.first_name as first_name and entry.author.last_name as last_name and entry.author.email as email %}
	    By <a href="mailto:{{ email }}">{{ first_name }} {{ last_name }}</a>
	    {% endblocktrans %}</cite></p>
	    <p class="entry_categories">Categories: {% for category in entry.categories.all %}<a href="{% url miraflores_categorized_entry_list category.slug %}">{{ category.name }}</a> {% empty %}<em>{% trans 'Uncategorized' %}</em>{% endfor %}</p>
	    <p class="entry_tags">Tags: {% for tag in entry.tags %}<a href="{% url miraflores_tagged_entry_list tag %}">{{ tag }}</a> {% empty %}<em>{% trans 'No tags' %}</em>{% endfor %} &rsaquo; {% get_comment_count for entry as comment_count %}{{ comment_count }} comment{{ comment_count|pluralize }}</p>
	  </div>
	</div>
	{% endfor %}
	<p id="page-nav">
		{% if page_obj.has_previous %}
		<a href="?page={{ page_obj.previous_page_number }}">&lsaquo; {% trans "Previous page" %}</a> |
		{% endif %}
		{% blocktrans with page_obj.number as number and paginator.num_pages as num_pages %}
		Page {{ number }} of {{ num_pages }}
		{% endblocktrans %}
		{% if page_obj.has_next %}
		| <a href="?page={{ page_obj.next_page_number }}">{% trans "Next page" %} &rsaquo;</a>
		{% endif %}
	</p>
</div>
{% endblock %}

{% block sidebar %}
{% define_slot com.djangoproject.base.content-related %}
{% endblock %}
